import { $rp } from '@/utils/constants';
import QuestionnaireIndex from '@/components/questionnaire/Index';
import QuestionnaireCreate from '@/components/questionnaire/Create';
import QuestionnaireShow from '@/components/questionnaire/Show';
import QuestionnairePreview from '@/components/questionnaire/Preview';
import QuestionnaireUpdate from '@/components/questionnaire/Update';
import QuestionnaireRelease from '@/components/questionnaire/Release';
import QuestionnaireAnswer from '@/components/questionnaire/Answer';
import QuestionnaireResults from '@/components/questionnaire/Results';

export default [
  {
    path: `/${$rp.QUESTIONNAIRES}`,
    component: QuestionnaireIndex,
    meta: { requireAuth: true },
  },
  {
    path: `/${$rp.QUESTIONNAIRES}/${$rp.CREATE}`,
    component: QuestionnaireCreate,
    meta: { requireAuth: true, hideHeaderReminder: true },
  },
  {
    path: `/${$rp.QUESTIONNAIRES}/${$rp.FILL_IN}`,
    component: QuestionnaireAnswer,
    meta: { requireAuth: true, hideHeaderReminder: true },
  },
  {
    path: `/${$rp.QUESTIONNAIRES}/:qnId`,
    component: QuestionnaireShow,
    children: [
      {
        path: $rp.PREVIEW,
        alias: '',
        component: QuestionnairePreview,
        meta: { requireAuth: true },
      },
      {
        path: $rp.UPDATE,
        component: QuestionnaireUpdate,
        meta: { requireAuth: true },
      },
      {
        path: $rp.RELEASE,
        component: QuestionnaireRelease,
        meta: { requireAuth: true },
      },
      {
        path: 'results',
        component: QuestionnaireResults,
        meta: { requireAuth: true },
      },
    ],
  },
];
